package com.linkhub.oms.data.sync.service;

import com.linkhub.oms.data.sync.api.shopify.domain.request.FulfillmentRequest;
import com.linkhub.oms.data.sync.api.shopify.domain.response.*;

import java.util.List;

/**
 * @Description: ShopifyApiService
 * @Author: echo
 * @Date: 2024/3/21 14:10
 * @Version: 1.0
 */
public interface ShopifyApiService {


    /**
     * 获取商店 access_token
     *
     * @param shopUrl           shopUrl
     * @param authorizationCode authorizationCode
     * @return OauthAccessTokenDTO
     */
    OauthAccessTokenResponse getShopAccessToken(String shopUrl, String authorizationCode);

    /**
     * 获取商店信息
     *
     * @param shopUrl     shopUrl
     * @param accessToken accessToken
     * @return shopInfo
     */
    ShopResponse getShopInfo(String shopUrl, String accessToken);

    /**
     * 拉取商店商品更新时间大于 {@code updatedAtMin} 的商品
     *
     * @param shopUrl      shopUrl
     * @param accessToken  accessToken
     * @param updatedAtMin updatedAtMin
     * @return products
     */
    ShopProductResponse pullShopAllProducts(String shopUrl, String accessToken, String updatedAtMin);

    /**
     * 拉取商店订单更新时间大于 {@code updatedAtMin} 的商品
     *
     * @param shopUrl      shopUrl
     * @param accessToken  accessToken
     * @param updatedAtMin updatedAtMin
     * @return orders
     */
    ShopOrderResponse pullShopAllOrders(String shopUrl, String accessToken, String updatedAtMin);

    /**
     * 根据订单id获取最新更新时间
     *
     * @param shopUrl     shopUrl
     * @param accessToken accessToken
     * @param orderIds    orderIds
     * @return orders
     */
    ShopOrderResponse getOrderLatestUpdateTime(String shopUrl, String accessToken, List<Long> orderIds);

    /**
     * 拉取商店运费名称
     *
     * @param shopUrl     shopUrl
     * @param accessToken accessToken
     * @return orders
     */
    ShopShippingNameResponse getShopShippingName(String shopUrl, String accessToken);

    FulfillmentOrderResponse fulfillmentOrders( String shopUrl, String accessToken, String orderId );

    FulfillmentResponse fulfillments( String shopUrl, String accessToken, FulfillmentRequest request );

    ShopAccessScopesResponse getShopAccessScopes( String url, String accessToken );
}
